package frame.form;

import java.util.Map;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class ActionListener  implements ServletContextListener{

	@Override
	public void contextDestroyed(ServletContextEvent arg0) {
		System.out.println("监听摧毁");
		
	}

	@Override
	public void contextInitialized(ServletContextEvent arg0) {
		ServletContext context = arg0.getServletContext();
		String xmlPath = context.getInitParameter("struts-config");
		System.out.println(xmlPath);
		String tomcatPath = context.getRealPath("/");
		System.out.println(tomcatPath);
		Map<String, XmlBean> map = Struts_config.getConfig(tomcatPath+xmlPath);
		context.setAttribute("struts", map);
		System.out.println("监听初始化");
	}

}
